package com.tencent.mm.opensdk.modelmsg;

import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;

import com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject;

public class WXDesignerSharedObject implements IMediaObject {
    private static final String TAG = "MicroMsg.SDK.WXEmojiSharedObject";
    public String designerName;
    public String designerRediretctUrl;
    public int designerUIN;
    public String thumburl;
    public String url;

    public WXDesignerSharedObject() {

    }

    public WXDesignerSharedObject(String arg1, int arg2, String arg3, String arg4) {

        this.url = arg3;
        this.thumburl = arg1;
        this.designerUIN = arg2;
        this.designerName = arg4;
    }

    public boolean checkArgs() {
        boolean v0;
        if(this.designerUIN == 0 || (TextUtils.isEmpty(this.thumburl)) || (TextUtils.isEmpty(this.url))) {
            Log.e("MicroMsg.SDK.WXEmojiSharedObject", "checkArgs fail, packageid or thumburl is invalid");
            v0 = false;
        }
        else {
            v0 = true;
        }

        return v0;
    }

    public void serialize(Bundle arg3) {
        arg3.putString("_wxemojisharedobject_thumburl", this.thumburl);
        arg3.putInt("_wxemojisharedobject_designer_uin", this.designerUIN);
        arg3.putString("_wxemojisharedobject_designer_name", this.designerName);
        arg3.putString("_wxemojisharedobject_designer_rediretcturl", this.designerRediretctUrl);
        arg3.putString("_wxemojisharedobject_url", this.url);
    }

    public int type() {
        return 25;
    }

    public void unserialize(Bundle arg2) {
        this.thumburl = arg2.getString("_wxwebpageobject_thumburl");
        this.designerUIN = arg2.getInt("_wxemojisharedobject_designer_uin");
        this.designerName = arg2.getString("_wxemojisharedobject_designer_name");
        this.designerRediretctUrl = arg2.getString("_wxemojisharedobject_designer_rediretcturl");
        this.url = arg2.getString("_wxwebpageobject_url");
    }
}

